import { http } from '@/utils'
// 获取登录数据
// 登录
export const getLogin = (data) => {
  return async (dispatch) => {
    const res = await http.post('/authorizations', data)
    const {
      data: { token },
      message,
    } = res.data
    if (message === 'OK') {
      localStorage.setItem('geek-pc-token', token)
      dispatch({ type: 'Login/getToken', payload: token })
    }
  }
}
